Skip to content

Conversation

r41k0u
Copy link
Collaborator

@r41k0u r41k0u commented Oct 5, 2025

No description provided.

@r41k0u r41k0u changed the title Refactor functions_pass Refactor handle_return Oct 5, 2025
@r41k0u
Copy link
Collaborator Author

r41k0u commented Oct 5, 2025

I have rescoped this PR to only refactor the handle_return part now, which has been done well.

@r41k0u r41k0u marked this pull request as ready for review October 5, 2025 23:35
@r41k0u r41k0u requested a review from Copilot October 5, 2025 23:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the return statement handling functionality in a Python-to-BPF compiler by extracting return logic into separate utility modules and improving code organization.

Key changes:

  • Extracted return handling logic from functions_pass.py into dedicated utility modules
  • Enhanced expression evaluation to support binary operations and ctypes casting
  • Added comprehensive test coverage for various return statement patterns

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pythonbpf/functions/return_utils.py New utility module containing extracted return handling functions
pythonbpf/functions/functions_pass.py Refactored to use new return handling utilities and updated imports
pythonbpf/functions/func_registry_handlers.py New registry pattern for statement handlers
pythonbpf/expr_pass.py Enhanced with ctypes casting and binary operation support
pythonbpf/type_deducer.py Reorganized code structure and added ctypes validation function
pythonbpf/codegen.py Updated import path for functions module
tests/passing_tests/return/*.py Added test files covering various return scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@r41k0u r41k0u merged commit 28ce14c into master Oct 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant